#![feature(result_option_inspect)]
// #![allow(unused)]

mod context;
mod metadata;
mod model;
mod provider;

use common_core::{ServiceComponent, ServiceContextBuilder, ServicePlugin};
use provider::{DictDataLoadLimited, MdmLoadServiceContextBuilder, MdmProcessLoadComponent};

#[no_mangle]
pub extern "C" fn loadMdmProcessLoadComponent() -> *const Box<dyn ServiceComponent> {
    let boxed: Box<Box<dyn ServiceComponent>> =
        Box::new(Box::new(MdmProcessLoadComponent::default()));
    Box::into_raw(boxed)
}

#[no_mangle]
pub extern "C" fn loadMdmLoadServiceContextBuilder() -> *const Box<dyn ServiceContextBuilder> {
    let boxed: Box<Box<dyn ServiceContextBuilder>> =
        Box::new(Box::new(MdmLoadServiceContextBuilder::default()));
    Box::into_raw(boxed)
}

#[no_mangle]
pub extern "C" fn loadDictDataLoadLimited() -> *const Box<dyn ServicePlugin> {
    let boxed: Box<Box<dyn ServicePlugin>> = Box::new(Box::new(DictDataLoadLimited::default()));
    Box::into_raw(boxed)
}

pub use metadata::MetadataManager;
